using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VSTMPZT
    {
        public DataRow Convert2STMPZT(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QuerySTMPZT(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["STMMANDANT"] = " ".PadRight(2 ); 
         dwReturn["STMSDAT"] = " ".PadRight(0 ); 
         dwReturn["STMSCHICHT"] = " ".PadRight(1 ); 
         dwReturn["STMMNRKRS"] = " ".PadRight(2 ); 
         dwReturn["STMMLFDNR"] = " ".PadRight(4 ); 
         dwReturn["STMMPOS"] = " ".PadRight(2 ); 
         dwReturn["STMPERSNR"] = " ".PadRight(8 ); 
         dwReturn["STMUHRVON"] = " ".PadRight(0 ); 
         dwReturn["STMUHRBIS"] = " ".PadRight(0 ); 
         dwReturn["STMDAUER"] = " ".PadRight(0 ); 
         dwReturn["STMBRACHZEIT"] = " ".PadRight(0 ); 
         dwReturn["STMSBDVRHF"] = " ".PadRight(0 ); 
         dwReturn["STMSBDVRHR"] = " ".PadRight(0 ); 
         dwReturn["STMSMNUTZEFF"] = " ".PadRight(0 ); 
         dwReturn["STMIBDVH"] = " ".PadRight(0 ); 
         dwReturn["STMIMNUTZEFF"] = " ".PadRight(0 ); 
         dwReturn["STMGKSTKRS"] = " ".PadRight(2 ); 
         dwReturn["STMGKST"] = " ".PadRight(4 ); 
         dwReturn["STMIAKSTKRS"] = " ".PadRight(2 ); 
         dwReturn["STMIAKST"] = " ".PadRight(4 ); 
         dwReturn["STMIPKSTKRS"] = " ".PadRight(2 ); 
         dwReturn["STMIPKST"] = " ".PadRight(4 ); 
         dwReturn["STMPGRP"] = " ".PadRight(1 ); 
         dwReturn["STMGLMZT"] = " ".PadRight(0 ); 
         dwReturn["STMGSMZT"] = " ".PadRight(0 ); 
         dwReturn["STMGRMZT"] = " ".PadRight(0 ); 
         dwReturn["STMGAMZT"] = " ".PadRight(0 ); 
         dwReturn["STMGFPZT"] = " ".PadRight(0 ); 
         dwReturn["STMGRPZT"] = " ".PadRight(0 ); 
         dwReturn["STMGAPZT"] = " ".PadRight(0 ); 
         dwReturn["STMPMPGRP1"] = " ".PadRight(0 ); 
         dwReturn["STMPMPGRP2"] = " ".PadRight(0 ); 
         dwReturn["STMPMPGRP3"] = " ".PadRight(0 ); 
         dwReturn["STMPMPGRP4"] = " ".PadRight(0 ); 
         dwReturn["STMPMPGRP5"] = " ".PadRight(0 ); 
         dwReturn["STMPMPGRP6"] = " ".PadRight(0 ); 
         dwReturn["STMLPGRP1"] = " ".PadRight(0 ); 
         dwReturn["STMLPGRP2"] = " ".PadRight(0 ); 
         dwReturn["STMLPGRP3"] = " ".PadRight(0 ); 
         dwReturn["STMLPGRP4"] = " ".PadRight(0 ); 
         dwReturn["STMLPGRP5"] = " ".PadRight(0 ); 
         dwReturn["STMLPGRP6"] = " ".PadRight(0 ); 
         dwReturn["STMME"] = " ".PadRight(1 ); 
         dwReturn["STMMGANZ"] = " ".PadRight(0 ); 
         dwReturn["STMMGMTR"] = " ".PadRight(0 ); 
         dwReturn["STMMGQM"] = " ".PadRight(0 ); 
         dwReturn["STMMGKG"] = " ".PadRight(0 ); 
         dwReturn["STMSLMZT"] = " ".PadRight(0 ); 
         dwReturn["STMSSMZT"] = " ".PadRight(0 ); 
         dwReturn["STMSRMZT"] = " ".PadRight(0 ); 
         dwReturn["STMSAMZT"] = " ".PadRight(0 ); 
         dwReturn["STMSFPZT"] = " ".PadRight(0 ); 
         dwReturn["STMSRPZT"] = " ".PadRight(0 ); 
         dwReturn["STMVST"] = " ".PadRight(1 ); 
         dwReturn["STMMINUTENTAB1"] = " ".PadRight(2000 ); 
         dwReturn["STMMINUTENTAB2"] = " ".PadRight(2000 ); 
         dwReturn["STMMINUTENTAB3"] = " ".PadRight(200 ); 
         dwReturn["STMNMGANZ"] = " ".PadRight(0 ); 
         dwReturn["STMNMGMTR"] = " ".PadRight(0 ); 
         dwReturn["STMNMGQM"] = " ".PadRight(0 ); 
         dwReturn["STMNMGKG"] = " ".PadRight(0 ); 
         dwReturn["STMNRGANZ"] = " ".PadRight(0 ); 
         dwReturn["STMNRGMTR"] = " ".PadRight(0 ); 
         dwReturn["STMNRGQM"] = " ".PadRight(0 ); 
         dwReturn["STMNRGKG"] = " ".PadRight(0 ); 
         dwReturn["STMFILLER"] = " ".PadRight(32 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapSTMPZT(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveSTMPZT(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QuerySTMPZT(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapSTMPZT(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertSTMPZT(dwLocal, ITXDBVERSION);
            }
            UpdateSTMPZT(dwLocal);
        }
        public void InsertSTMPZT(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO STMPZT(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QuerySTMPZT(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM STMPZT WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM STMPZT  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "STMPZT";
            Return = Result;
            return Return;
        }
        public void DeleteSTMPZT(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM STMPZT   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateSTMPZT(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE STMPZT SET "
                    +"STMMANDANT= :STMMANDANT,"
                    +"STMSDAT= :STMSDAT,"
                    +"STMSCHICHT= :STMSCHICHT,"
                    +"STMMNRKRS= :STMMNRKRS,"
                    +"STMMLFDNR= :STMMLFDNR,"
                    +"STMMPOS= :STMMPOS,"
                    +"STMPERSNR= :STMPERSNR,"
                    +"STMUHRVON= :STMUHRVON,"
                    +"STMUHRBIS= :STMUHRBIS,"
                    +"STMDAUER= :STMDAUER,"
                    +"STMBRACHZEIT= :STMBRACHZEIT,"
                    +"STMSBDVRHF= :STMSBDVRHF,"
                    +"STMSBDVRHR= :STMSBDVRHR,"
                    +"STMSMNUTZEFF= :STMSMNUTZEFF,"
                    +"STMIBDVH= :STMIBDVH,"
                    +"STMIMNUTZEFF= :STMIMNUTZEFF,"
                    +"STMGKSTKRS= :STMGKSTKRS,"
                    +"STMGKST= :STMGKST,"
                    +"STMIAKSTKRS= :STMIAKSTKRS,"
                    +"STMIAKST= :STMIAKST,"
                    +"STMIPKSTKRS= :STMIPKSTKRS,"
                    +"STMIPKST= :STMIPKST,"
                    +"STMPGRP= :STMPGRP,"
                    +"STMGLMZT= :STMGLMZT,"
                    +"STMGSMZT= :STMGSMZT,"
                    +"STMGRMZT= :STMGRMZT,"
                    +"STMGAMZT= :STMGAMZT,"
                    +"STMGFPZT= :STMGFPZT,"
                    +"STMGRPZT= :STMGRPZT,"
                    +"STMGAPZT= :STMGAPZT,"
                    +"STMPMPGRP1= :STMPMPGRP1,"
                    +"STMPMPGRP2= :STMPMPGRP2,"
                    +"STMPMPGRP3= :STMPMPGRP3,"
                    +"STMPMPGRP4= :STMPMPGRP4,"
                    +"STMPMPGRP5= :STMPMPGRP5,"
                    +"STMPMPGRP6= :STMPMPGRP6,"
                    +"STMLPGRP1= :STMLPGRP1,"
                    +"STMLPGRP2= :STMLPGRP2,"
                    +"STMLPGRP3= :STMLPGRP3,"
                    +"STMLPGRP4= :STMLPGRP4,"
                    +"STMLPGRP5= :STMLPGRP5,"
                    +"STMLPGRP6= :STMLPGRP6,"
                    +"STMME= :STMME,"
                    +"STMMGANZ= :STMMGANZ,"
                    +"STMMGMTR= :STMMGMTR,"
                    +"STMMGQM= :STMMGQM,"
                    +"STMMGKG= :STMMGKG,"
                    +"STMSLMZT= :STMSLMZT,"
                    +"STMSSMZT= :STMSSMZT,"
                    +"STMSRMZT= :STMSRMZT,"
                    +"STMSAMZT= :STMSAMZT,"
                    +"STMSFPZT= :STMSFPZT,"
                    +"STMSRPZT= :STMSRPZT,"
                    +"STMVST= :STMVST,"
                    +"STMMINUTENTAB1= :STMMINUTENTAB1,"
                    +"STMMINUTENTAB2= :STMMINUTENTAB2,"
                    +"STMMINUTENTAB3= :STMMINUTENTAB3,"
                    +"STMNMGANZ= :STMNMGANZ,"
                    +"STMNMGMTR= :STMNMGMTR,"
                    +"STMNMGQM= :STMNMGQM,"
                    +"STMNMGKG= :STMNMGKG,"
                    +"STMNRGANZ= :STMNRGANZ,"
                    +"STMNRGMTR= :STMNRGMTR,"
                    +"STMNRGQM= :STMNRGQM,"
                    +"STMNRGKG= :STMNRGKG,"
                    +"STMFILLER= :STMFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("STMMANDANT", OracleType.NVarChar).Value = dwData["STMMANDANT"].ToString(); 
          or1.Parameters.Add("STMSDAT", OracleType.NVarChar).Value = dwData["STMSDAT"].ToString(); 
          or1.Parameters.Add("STMSCHICHT", OracleType.NVarChar).Value = dwData["STMSCHICHT"].ToString(); 
          or1.Parameters.Add("STMMNRKRS", OracleType.NVarChar).Value = dwData["STMMNRKRS"].ToString(); 
          or1.Parameters.Add("STMMLFDNR", OracleType.NVarChar).Value = dwData["STMMLFDNR"].ToString(); 
          or1.Parameters.Add("STMMPOS", OracleType.NVarChar).Value = dwData["STMMPOS"].ToString(); 
          or1.Parameters.Add("STMPERSNR", OracleType.NVarChar).Value = dwData["STMPERSNR"].ToString(); 
          or1.Parameters.Add("STMUHRVON", OracleType.NVarChar).Value = dwData["STMUHRVON"].ToString(); 
          or1.Parameters.Add("STMUHRBIS", OracleType.NVarChar).Value = dwData["STMUHRBIS"].ToString(); 
          or1.Parameters.Add("STMDAUER", OracleType.NVarChar).Value = dwData["STMDAUER"].ToString(); 
          or1.Parameters.Add("STMBRACHZEIT", OracleType.NVarChar).Value = dwData["STMBRACHZEIT"].ToString(); 
          or1.Parameters.Add("STMSBDVRHF", OracleType.NVarChar).Value = dwData["STMSBDVRHF"].ToString(); 
          or1.Parameters.Add("STMSBDVRHR", OracleType.NVarChar).Value = dwData["STMSBDVRHR"].ToString(); 
          or1.Parameters.Add("STMSMNUTZEFF", OracleType.NVarChar).Value = dwData["STMSMNUTZEFF"].ToString(); 
          or1.Parameters.Add("STMIBDVH", OracleType.NVarChar).Value = dwData["STMIBDVH"].ToString(); 
          or1.Parameters.Add("STMIMNUTZEFF", OracleType.NVarChar).Value = dwData["STMIMNUTZEFF"].ToString(); 
          or1.Parameters.Add("STMGKSTKRS", OracleType.NVarChar).Value = dwData["STMGKSTKRS"].ToString(); 
          or1.Parameters.Add("STMGKST", OracleType.NVarChar).Value = dwData["STMGKST"].ToString(); 
          or1.Parameters.Add("STMIAKSTKRS", OracleType.NVarChar).Value = dwData["STMIAKSTKRS"].ToString(); 
          or1.Parameters.Add("STMIAKST", OracleType.NVarChar).Value = dwData["STMIAKST"].ToString(); 
          or1.Parameters.Add("STMIPKSTKRS", OracleType.NVarChar).Value = dwData["STMIPKSTKRS"].ToString(); 
          or1.Parameters.Add("STMIPKST", OracleType.NVarChar).Value = dwData["STMIPKST"].ToString(); 
          or1.Parameters.Add("STMPGRP", OracleType.NVarChar).Value = dwData["STMPGRP"].ToString(); 
          or1.Parameters.Add("STMGLMZT", OracleType.NVarChar).Value = dwData["STMGLMZT"].ToString(); 
          or1.Parameters.Add("STMGSMZT", OracleType.NVarChar).Value = dwData["STMGSMZT"].ToString(); 
          or1.Parameters.Add("STMGRMZT", OracleType.NVarChar).Value = dwData["STMGRMZT"].ToString(); 
          or1.Parameters.Add("STMGAMZT", OracleType.NVarChar).Value = dwData["STMGAMZT"].ToString(); 
          or1.Parameters.Add("STMGFPZT", OracleType.NVarChar).Value = dwData["STMGFPZT"].ToString(); 
          or1.Parameters.Add("STMGRPZT", OracleType.NVarChar).Value = dwData["STMGRPZT"].ToString(); 
          or1.Parameters.Add("STMGAPZT", OracleType.NVarChar).Value = dwData["STMGAPZT"].ToString(); 
          or1.Parameters.Add("STMPMPGRP1", OracleType.NVarChar).Value = dwData["STMPMPGRP1"].ToString(); 
          or1.Parameters.Add("STMPMPGRP2", OracleType.NVarChar).Value = dwData["STMPMPGRP2"].ToString(); 
          or1.Parameters.Add("STMPMPGRP3", OracleType.NVarChar).Value = dwData["STMPMPGRP3"].ToString(); 
          or1.Parameters.Add("STMPMPGRP4", OracleType.NVarChar).Value = dwData["STMPMPGRP4"].ToString(); 
          or1.Parameters.Add("STMPMPGRP5", OracleType.NVarChar).Value = dwData["STMPMPGRP5"].ToString(); 
          or1.Parameters.Add("STMPMPGRP6", OracleType.NVarChar).Value = dwData["STMPMPGRP6"].ToString(); 
          or1.Parameters.Add("STMLPGRP1", OracleType.NVarChar).Value = dwData["STMLPGRP1"].ToString(); 
          or1.Parameters.Add("STMLPGRP2", OracleType.NVarChar).Value = dwData["STMLPGRP2"].ToString(); 
          or1.Parameters.Add("STMLPGRP3", OracleType.NVarChar).Value = dwData["STMLPGRP3"].ToString(); 
          or1.Parameters.Add("STMLPGRP4", OracleType.NVarChar).Value = dwData["STMLPGRP4"].ToString(); 
          or1.Parameters.Add("STMLPGRP5", OracleType.NVarChar).Value = dwData["STMLPGRP5"].ToString(); 
          or1.Parameters.Add("STMLPGRP6", OracleType.NVarChar).Value = dwData["STMLPGRP6"].ToString(); 
          or1.Parameters.Add("STMME", OracleType.NVarChar).Value = dwData["STMME"].ToString(); 
          or1.Parameters.Add("STMMGANZ", OracleType.NVarChar).Value = dwData["STMMGANZ"].ToString(); 
          or1.Parameters.Add("STMMGMTR", OracleType.NVarChar).Value = dwData["STMMGMTR"].ToString(); 
          or1.Parameters.Add("STMMGQM", OracleType.NVarChar).Value = dwData["STMMGQM"].ToString(); 
          or1.Parameters.Add("STMMGKG", OracleType.NVarChar).Value = dwData["STMMGKG"].ToString(); 
          or1.Parameters.Add("STMSLMZT", OracleType.NVarChar).Value = dwData["STMSLMZT"].ToString(); 
          or1.Parameters.Add("STMSSMZT", OracleType.NVarChar).Value = dwData["STMSSMZT"].ToString(); 
          or1.Parameters.Add("STMSRMZT", OracleType.NVarChar).Value = dwData["STMSRMZT"].ToString(); 
          or1.Parameters.Add("STMSAMZT", OracleType.NVarChar).Value = dwData["STMSAMZT"].ToString(); 
          or1.Parameters.Add("STMSFPZT", OracleType.NVarChar).Value = dwData["STMSFPZT"].ToString(); 
          or1.Parameters.Add("STMSRPZT", OracleType.NVarChar).Value = dwData["STMSRPZT"].ToString(); 
          or1.Parameters.Add("STMVST", OracleType.NVarChar).Value = dwData["STMVST"].ToString(); 
          or1.Parameters.Add("STMMINUTENTAB1", OracleType.NVarChar).Value = dwData["STMMINUTENTAB1"].ToString(); 
          or1.Parameters.Add("STMMINUTENTAB2", OracleType.NVarChar).Value = dwData["STMMINUTENTAB2"].ToString(); 
          or1.Parameters.Add("STMMINUTENTAB3", OracleType.NVarChar).Value = dwData["STMMINUTENTAB3"].ToString(); 
          or1.Parameters.Add("STMNMGANZ", OracleType.NVarChar).Value = dwData["STMNMGANZ"].ToString(); 
          or1.Parameters.Add("STMNMGMTR", OracleType.NVarChar).Value = dwData["STMNMGMTR"].ToString(); 
          or1.Parameters.Add("STMNMGQM", OracleType.NVarChar).Value = dwData["STMNMGQM"].ToString(); 
          or1.Parameters.Add("STMNMGKG", OracleType.NVarChar).Value = dwData["STMNMGKG"].ToString(); 
          or1.Parameters.Add("STMNRGANZ", OracleType.NVarChar).Value = dwData["STMNRGANZ"].ToString(); 
          or1.Parameters.Add("STMNRGMTR", OracleType.NVarChar).Value = dwData["STMNRGMTR"].ToString(); 
          or1.Parameters.Add("STMNRGQM", OracleType.NVarChar).Value = dwData["STMNRGQM"].ToString(); 
          or1.Parameters.Add("STMNRGKG", OracleType.NVarChar).Value = dwData["STMNRGKG"].ToString(); 
          or1.Parameters.Add("STMFILLER", OracleType.NVarChar).Value = dwData["STMFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
